package exttable.view;

import exttable.dbclasses.DataType;
import utils.Localisation;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: Jun 10, 2010
 * Time: 11:47:44 AM
 * To change this template use File | Settings | File Templates.
 */
public class ViewAnalysisParameter extends ViewLocales implements Serializable {
    private int parameterID;
    private boolean present;
    private ViewUnits unit;
    private Double maxValue;
    private Double minValue;
    private ViewSize size;
    private String strMax;
    private int order;
    private DataType typeVariable;


    public int getParameterID() {
        return parameterID;
    }

    public void setParameterID(int parameterID) {
        this.parameterID = parameterID;
    }

    public ViewUnits getUnit() {
        return unit;
    }

    public void setUnit(ViewUnits unit) {
        this.unit = unit;
    }

    public boolean isPresent() {
        return present;
    }

    public void setPresent(boolean present) {
        this.present = present;
    }

    public Double getMaxValue() {
        return maxValue;
    }

    public void setMaxValue(Double maxValue) {
        this.maxValue = maxValue;
    }

    public Double getMinValue() {
        return minValue;
    }

    public void setMinValue(Double minValue) {
        this.minValue = minValue;
    }

    public boolean isMinAndMaxNull() {
        return maxValue == 0 & minValue == 0;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public ViewSize getSize() {
        return size;
    }

    public void setSize(ViewSize size) {
        this.size = size;
    }

    public String getStrMax() {
        return strMax;
    }

    public void setStrMax(String strMax) {
        this.strMax = strMax;
    }

    public DataType getTypeVariable() {
        return typeVariable;
    }

    public void setTypeVariable(DataType typeVariable) {
        this.typeVariable = typeVariable;
    }

    public static class Build implements IBuilder {

        private String nameRu;
        private String nameKz;
        private String nameEn;

        public Build nameRu(String nameRu) {
            this.nameRu = nameRu;
            return this;
        }

        public Build nameKz(String nameKz) {
            this.nameKz = nameKz;
            return this;
        }

        public Build nameEn(String nameEn) {
            this.nameEn = nameEn;
            return this;
        }

        @Override
        public ViewAnalysisParameter build() {
            return new ViewAnalysisParameter(this);
        }
    }

    public ViewAnalysisParameter(Build build) {
        setNameRu(build.nameRu);
        setNameEn(build.nameEn);
        setNameKz(build.nameKz);
    }
}
